#ifndef SKILLS_H
#define SKILLS_H

#include "dtwenty_global.h"

#include <collection.h>
#include <item.h>

#include <QMetaType>


typedef Item Skill;


class DTWENTYSHARED_EXPORT Skills : public Collection
{
    Q_OBJECT

public:

    enum Field
    {
        Field_FIRST = 0,

        Field_NAME = Field_FIRST,
        Field_DESC,
        Field_ATTR,
        Field_SYNERGY,

        Field_LAST = Field_SYNERGY
    };


    Q_INVOKABLE Skills(QObject *parent = 0) :
        Collection(QT_TR_NOOP("Skills"), parent)
    {
    }

    Skills(const Skills& other) :
        Collection(other)
    {
    }

    Q_INVOKABLE virtual void onInitialize()
    {
        setField(Field_NAME, QT_TR_NOOP("Name"));
        setField(Field_DESC, QT_TR_NOOP("Description"));
        setField(Field_ATTR, QT_TR_NOOP("Attribute"));
        setField(Field_SYNERGY, QT_TR_NOOP("Synergies"));

        MetaItem* item = metaData()->item(Field_ATTR);
        item->setOptionRef("Attributes");

        item = metaData()->item(Field_SYNERGY);
        item->setOptionRef("Skills");
        item->setEditType(MetaItem::EditType_MULTI);
    }


};

Q_DECLARE_METATYPE(Skills*)


#endif // SKILLS_H
